/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package project.jpdftools.ui.actionlisteners;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import project.jpdftools.ui.logic.JPDF;
import project.jpdftools.ui.MainMenu;

/**
 *
 * @author Mido
 */
public class ShowMenuAction implements MouseListener {

    private Object component;

    public ShowMenuAction(Object component) {
        super();
        this.component = component;
    }

    @Override
    public void mouseClicked(MouseEvent e) {
        if (e.getButton() == 3) {
            JPDF jpdf = (JPDF) component;
            // show the popup menu relatively to the MainMenu
            jpdf.getMenu().show(MainMenu.getInstance(), e.getXOnScreen(), e.getYOnScreen());
        }
    }

    public void mousePressed(MouseEvent e) {
    }

    public void mouseReleased(MouseEvent e) {
    }

    public void mouseEntered(MouseEvent e) {
    }

    public void mouseExited(MouseEvent e) {
    }
}
